<template>
    <view class="purchaseDetailContainer">
        <!-- 充值 -->
        <cunstom_navigation_bar :tapEvent="goback" :propStyles="propStyles" :title="'充值'">
        </cunstom_navigation_bar>
        <view class="contentBox">
            <view class="rechargeBox">
                <view class="left">充值方式</view>
                <view class="right">微信支付 ></view>
            </view>
            <view class="cashOut">
                <view class="title">提现余额</view>
                <view class="inputBox">
                    <view class="left">￥</view>
                    <uni-easyinput v-model="amount" />
                </view>
                <view class="bottom">
                    <view class="left">可提现余额￥125.25</view>
                    <view class="right">全部提现</view>
                </view>
            </view>
        </view>



        <view class="zhanwei"></view>




    </view>
</template>
<script>
    const util = require("@/utils/util.js");
    const api = require("@/utils/api.js");
    var QQMapWX = require('../utils/qqmap-wx-jssdk.js');
    const mapChange = require('../utils/mapChange.js');

    const app = getApp();
    export default {
        data() {
            return {

                amount: 1,




                imgDomain: "",

                propStyles: {

                    iconSrc: "black",
                    // bgColor: '#FECF01',

                }

            };
        },
        computed: {

        },
        methods: {
            goBack() {

                uni.navigateBack()
            },

            jumpUrl(num) {
                if (num == 1) {
                    uni.navigateTo({

                        url: `/page_changeAddress/changeAddress?id=${this.defaultAddress.id}&mallProductId=${this.mallProductId}&skuId=${this.skuId}&quantity=${this.quantity}`
                    })
                } else if (num == 2) {
                    uni.navigateTo({
                        url: `/page_addressEdit/addressEdit?id=null&mallProductId=${this.mallProductId}&skuId=${this.skuId}&quantity=${this.quantity}`
                    })
                } else if (num == 3) {
                    uni.navigateTo({
                        url: `/page_protocol/protocol`,
                    })
                }

            },
            getOrderAddress(id) {
                util.request(api.getOrderAddress, {


                }, 'GET', 'application/json').then(res => {

                    if (res.code == 200) {
                        let addressList
                        addressList = res.rows
                        // this.defaultAddress = addressList[0]
                        // this.defaultAddress = []
                        if (id) { //从修改地址页面过来，使用修改后的值

                        } else {//使用默认值


                        }
                        addressList.forEach((el) => {
                            if ((!id && el.isDefault == 1) || (id && el.id == id)) {
                                this.defaultAddress = el
                            }

                        })
                        this.getGoodInfo();

                    } else {
                        util.toast('查询失败')
                    }

                }).catch((err) => {
                    console.log('err', err)

                });
            },
            getGoodInfo() {
                let queryParams = {
                    mallProductId: this.mallProductId,
                    quantity: this.quantity,
                }
                if (this.defaultAddress.id) {
                    queryParams.addressID = this.defaultAddress.id
                }

                util
                    .request(
                        api.productDetail,
                        queryParams,
                        "GET",
                        "application/json"
                    )
                    .then((res) => {
                        if (res.code == 200) {
                            this.antiqueDetail = JSON.parse(JSON.stringify(res.data))
                            if (this.antiqueDetail.deliveryType == 3) {
                                this.getLocation()
                            }

                            this.antiqueDetail.wxNormalMallProductSkuVoList.forEach(element => {
                                if (element.skuId == this.skuId) {
                                    this.selectedOption = element
                                }
                            });


                        } else {
                            util.toast("获取失败，请重试~");
                        }
                    })
                    .catch((err) => {
                        console.log("err", err);
                        reject(err);
                    });
            },








            goback() {
                console.log("回去");
                uni.navigateBack();
            },


        },
        onReady() { },
        // onShow(){

        //       },
        created() { },
        onShow: function () {

        },
        watch: {

        },


        onLoad: function (option) {



            this.imgDomain = process.env.VUE_APP_BASE_URL;




        },

    };
</script>
<style lang="scss">
    page {
        height: 100vh;
        overflow: auto;
        background: #F4F4F2;
    }
</style>
<style lang="scss" scoped>
    .purchaseDetailContainer {
        background: #f4f4f2;
        box-sizing: border-box;

        /* ::v-deep .companyInfoContainer {
        position: absolute;
        top: 0rpx;
        left: 0rpx;
  
        .navigationBar {
          background: transparent;
        }
      } */
    }

    .contentBox {
        width: 100%;
        display: flex;
        align-items: center;
        flex-direction: column;
        padding-top: 38rpx;

        .rechargeBox {
            width: 690rpx;
            height: 104rpx;
            background: #FFFFFF;
            box-shadow: 0rpx 2rpx 10rpx 0rpx rgba(0, 0, 0, 0.1);
            border-radius: 20rpx 20rpx 20rpx 20rpx;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding-left: 26rpx;
            padding-right: 24rpx;

            .left {
                font-weight: 500;
                font-size: 32rpx;
                color: #333333;
            }

            .right {
                font-weight: 400;
                font-size: 24rpx;
                color: #9E9E9E;
            }
        }

        .cashOut {
            width: 690rpx;
            height: 306rpx;
            background: #FFFFFF;
            box-shadow: 0rpx 2rpx 10rpx 0rpx rgba(0, 0, 0, 0.1);
            border-radius: 20rpx 20rpx 20rpx 20rpx;
            padding: 32rpx 26rpx 20rpx;
            margin-top: 20rpx;

            .title {
                font-weight: 500;
                font-size: 32rpx;
                color: #333333;
            }

            .inputBox {
                margin-top: 80rpx;
                display: flex;
                width: 100%;
                align-items: flex-end;
                border-bottom: 2rpx solid rgba(51, 51, 51, 0.1);

                .left {
                    font-weight: 400;
                    font-size: 28rpx;
                    color: #333333;
                }
            }

            .bottom {
                display: flex;
                justify-content: space-between;
                margin-top: 30rpx;

                .left {
                    font-weight: 400;
                    font-size: 20rpx;
                    color: rgba(51, 51, 51, 0.5);
                }

                .right {
                    font-weight: 500;
                    font-size: 20rpx;
                    color: #D93F11;
                }
            }
        }
    }

    /deep/ .is-input-border {
        border: none;
        align-items: flex-end;
    }

    /deep/ .uni-easyinput__content-input {
        font-size: 72rpx;
    }
</style>